package com.hujiang.basic.search.common.converter.req;

import org.elasticsearch.action.index.IndexRequest;
import org.springframework.stereotype.Component;

import com.hujiang.basic.search.common.converter.Converter;
import com.hujiang.basic.search.model.HJIndexRequest;

@Component
public class IndexRequestConverter implements Converter<HJIndexRequest, IndexRequest> {

    @Override
    public IndexRequest convert(HJIndexRequest in) {
        return new IndexRequest(in.getIndex(), in.getType(), in.getId()).source(in.getSource());
    }
}
